package com.jic.member.constant.enums;

/**
 * @author yinhaijun
 * @date: 2020/6/6
 */
public enum WaitePeriodEnum {

    MINUTE(1, "分钟"),
    HOUR(2, "小时"),
    DAY(3, "天"),
    WEEK(4, "周"),
    MONTH(5, "月");

    private Integer code;

    private String message;

    WaitePeriodEnum(Integer code, String message){
        this.code = code;
        this.message = message;
    }

    public WaitePeriodEnum getByCode(Integer code){
        WaitePeriodEnum[] values = WaitePeriodEnum.values();
        for(WaitePeriodEnum value : values){
            if(value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
